Fix handling of stock items without icons in action-based ui. (#342458,
authorMatthias Clasen <mclasen@redhat.com>
Tue, 20 Jun 2006 18:01:23 +0000 (18:01 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 20 Jun 2006 18:01:23 +0000 (18:01 +0000)
2006-06-20  Matthias Clasen  <mclasen@redhat.com>

Fix handling of stock items without icons in action-based
ui.  (#342458, Callum McKenzie)

* gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Set
the stock id even if there is no icon for it.

* gtk/gtkaction.c (connect_proxy):
* gtk/gtktoolbutton.c (gtk_tool_button_construct_contents): Only
construct a stock icon if the stock item has an icon.

ChangeLog
ChangeLog.pre-2-10
gtk/gtkaction.c
gtk/gtkactiongroup.c
gtk/gtktoolbutton.c

index 3cb6e41e79b8059369086bd9374244639727de0c..d2dfab3777844d57c45e7e311eb761d891372a7f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-06-20  Matthias Clasen  <mclasen@redhat.com>
+
+       Fix handling of stock items without icons in action-based
+       ui.  (#342458, Callum McKenzie)
+       
+       * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Set
+       the stock id even if there is no icon for it.
+
+       * gtk/gtkaction.c (connect_proxy): 
+       * gtk/gtktoolbutton.c (gtk_tool_button_construct_contents): Only
+       construct a stock icon if the stock item has an icon.
+
 2006-06-20  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_column_drag_info): Better 
index 3cb6e41e79b8059369086bd9374244639727de0c..d2dfab3777844d57c45e7e311eb761d891372a7f 100644 (file)
@@ -1,3 +1,15 @@
+2006-06-20  Matthias Clasen  <mclasen@redhat.com>
+
+       Fix handling of stock items without icons in action-based
+       ui.  (#342458, Callum McKenzie)
+       
+       * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Set
+       the stock id even if there is no icon for it.
+
+       * gtk/gtkaction.c (connect_proxy): 
+       * gtk/gtktoolbutton.c (gtk_tool_button_construct_contents): Only
+       construct a stock icon if the stock item has an icon.
+
 2006-06-20  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_column_drag_info): Better 
index afc80780aedd16b76c4e51b94c8d01956ef22a0c..6822e5f5cf53601dd3c751b0c0227f4e9efcd224 100644 (file)
@@ -712,7 +712,9 @@ connect_proxy (GtkAction     *action,
                                             image);
              gtk_widget_show (image);
            }
-         if (action->private_data->stock_id)
+         
+         if (action->private_data->stock_id &&
+             gtk_icon_factory_lookup_default (action->private_data->stock_id))
            gtk_image_set_from_stock (GTK_IMAGE (image),
                                      action->private_data->stock_id, GTK_ICON_SIZE_MENU);
          else if (action->private_data->icon_name)
index dfa48f7461e3881f1c94f9a1b83b4ffe14be2d2c..7b7bd6b7f6d047cf85f89aefedb85a2abaada2f9 100644 (file)
@@ -782,9 +782,9 @@ gtk_action_group_add_actions_full (GtkActionGroup       *action_group,
 
       if (entries[i].stock_id) 
        {
-         if (gtk_icon_factory_lookup_default (entries[i].stock_id))
-           g_object_set (action, "stock-id", entries[i].stock_id, NULL);
-         else
+         g_object_set (action, "stock-id", entries[i].stock_id, NULL);
+         if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), 
+                                      entries[i].stock_id))
            g_object_set (action, "icon-name", entries[i].stock_id, NULL);
        }
          
index ae9c7ad550482cbcce0426f2e57fb34db65d900f..5c7ff4daf146adab4df9925a7e5b2dc047a7cd6f 100644 (file)
@@ -405,7 +405,8 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
                            NULL);
            }
        }
-      else if (button->priv->stock_id)
+      else if (button->priv->stock_id && 
+              gtk_icon_factory_lookup_default (button->priv->stock_id))
        {
          icon = gtk_image_new_from_stock (button->priv->stock_id, icon_size);
          gtk_widget_show (icon);